local liuhe = fk.CreateSkill {
  name = "lingling__liuhe",
}

Fk:loadTranslationTable{
  ["lingling__liuhe"] = "六合",
  [":lingling__liuhe"] = "出牌阶段，你可以将两张花色相同的手牌当【万箭齐发】使用。",

  ["#lingling__liuhe"] = "六合：你可以将两张相同花色的手牌当【万箭齐发】",
}

liuhe:addEffect("viewas", {
  anim_type = "offensive",
  mute_card = false,
  prompt = "#lingling__liuhe",
  handly_pile = true,
  card_filter = function(self, player, to_select, selected)
    if #selected < 2 and table.contains(player:getHandlyIds(), to_select) then
      if #selected == 0 then
        return Fk:getCardById(to_select).suit ~= Card.NoSuit
      else
        return Fk:getCardById(to_select):compareSuitWith(Fk:getCardById(selected[1]))
      end
    end
  end,
  view_as = function(self, player, cards)
    if #cards ~= 2 then return end
    local card = Fk:cloneCard("archery_attack")
    card.skillName = liuhe.name
    card:addSubcards(cards)
    return card
  end,
})

return liuhe
